package cn.com.haopy.yue.ai.admin.web;


import cn.com.haopy.yue.ai.db.entity.arisk.HOSAdmin;
import cn.com.haopy.yue.ai.db.service.hos.HOSAdminService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;

public class AdminBaseController {
    protected final Log logger = LogFactory.getLog(this.getClass());

    @Autowired
    private HOSAdminService adminService;

    public HOSAdmin getAdmin() {
        Subject currentUser = SecurityUtils.getSubject();
        HOSAdmin admin = (HOSAdmin) currentUser.getPrincipal();

        return adminService.getById(admin.getId());
    }
}
